<?php
/**********************************************************************
 *                                                                    *    
 * Copyright (c) 2009 Dmytro Bezhnar. All rights reserved.     *
 *                                                                    *
 **********************************************************************/

/**
 * Ageset entity manager.
 *
 * @version $Id: PathManager.php,v 1.7 2008/05/19 14:33:19 sdobrovol Exp $
 */
class PathManager extends ORMManager
{
   function getPath($key_word)
   {
   		$obj = $this->getQuery()->select('t.text')->from('LanguageTableDBO t')->innerJoin('t.LanguageWordsDBO w')
   		->where("w.word='$key_word' and t.lang_code='".$_SESSION['lang_code']."'")->useResultCache(true,$GLOBALS['options']['memcache_core']['path_time'])->fetchOne();
   		if (is_object($obj)){
   			return $obj->text;
   		}else{
   			return $key_word;
   		}

   }
   
   function encodeStr2Url($str) {
   		return urlencode(iconv('Windows-1251', 'UTF-8', $str));
   }
}

?>